package com.zhentao.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhentao.entity.product.Brand;
import com.zhentao.service.BrandService;
import com.zhentao.mapper.BrandMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Lenovo
* @description 针对表【brand(分类品牌)】的数据库操作Service实现
* @createDate 2024-09-02 15:27:01
*/
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand>
    implements BrandService{
    @Resource
    private BrandMapper brandMapper;
    /**
     * 品牌列表
     * @param page
     * @param limit
     * @return
     */
    @Override
    public Page<Brand> findByPage(Integer page, Integer limit) {
        Page<Brand> page1 = new Page<>(page,limit);
        Page<Brand> page2 = brandMapper.findByPage(page1);
        return page2;
    }
    /**
     * 品牌下拉列表
     * @return
     */
    @Override
    public List<Brand> findAll() {
        List<Brand> brands = brandMapper.selectList(Wrappers.<Brand>lambdaQuery().eq(Brand::getIsDeleted, 0));
        return brands;
    }
}




